From eacdd4f1287a43286850c05613de2f049eccc488 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild2.aw" Date: Thu, 4 Jan 2007 16:10:25 -0700 Subject: [PATCH] [IA64] Fix calling xencomm_copy_chunk_{to, from} with len = 0 Originally debugged by Kazuhiro Suzuki Signed-off-by: Isaku Yamahata --- xen/arch/ia64/xen/xencomm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/ia64/xen/xencomm.c b/xen/arch/ia64/xen/xencomm.c index 3b8e40b5b3..21eef3a51a 100644 --- a/xen/arch/ia64/xen/xencomm.c +++ b/xen/arch/ia64/xen/xencomm.c @@ -153,7 +153,7 @@ xencomm_copy_from_guest( chunksz -= chunk_skip; skip -= chunk_skip; - if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned int bytes = min(chunksz, n - to_pos); int res; @@ -295,7 +295,7 @@ xencomm_copy_to_guest( skip -= chunk_skip; dest_paddr += chunk_skip; - if (skip == 0) { + if (skip == 0 && chunksz > 0) { unsigned int bytes = min(chunksz, n - from_pos); int res; -- 2.30.2